package com.zhongyouyun.admin.service.imp;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhongyouyun.admin.model.DictModel;
import com.zhongyouyun.admin.mapper.DictMapper;
import com.zhongyouyun.admin.model.MenuModel;
import com.zhongyouyun.admin.model.RoleModel;
import com.zhongyouyun.admin.pojo.DictPojo;
import com.zhongyouyun.admin.service.DictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

/**
 * @Author: shenyi
 * @Date: 2021-12-20
 * @Description: 服务实现类
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class DictServiceImpl extends ServiceImpl<DictMapper, DictModel> implements DictService {
    /*
     * @Author: shenyi
     * @Date: 2021-09-08
     * @Description: 分页查询
     * @param page 分页数据  lambdaQueryWrapper where 条件 和排序
     */
    @Override
    public IPage<DictModel> selectPage(Page<DictModel> page, QueryWrapper<DictModel> queryWrapper) {
        return this.baseMapper.selectPage(page, queryWrapper);
    }

    @Override
    public IPage selectUserPage(Page page, QueryWrapper<DictModel> queryWrapper, int id,String state) {
        return this.baseMapper.selectUserPage(page, queryWrapper, id,state);
    }

    @Override
    public IPage<DictPojo> selectPojoPage(Page page, QueryWrapper<DictPojo> queryWrapper) {
        return this.baseMapper.selectPojoPage(page, queryWrapper);
    }

    /*
     * @Author: shenyi
     * @Date: 2021-09-08
     * @Description: 查询全部
     * @param   lambdaQueryWrapper where 条件 和排序
     */
    @Override
    public List<DictModel> selectList(QueryWrapper<DictModel> queryWrapper) {
        return this.baseMapper.selectList(queryWrapper);
    }

    @Override
    public List<DictModel> selectListbyRoleId(RoleModel roleModel) {
        return this.baseMapper.selectListbyRoleId(roleModel);
    }


}
